package myPack.GMAO.Bean;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import myPack.GMAO.Entity.Privilege;
import myPack.GMAO.Interface.PriviligeInterface;

@Stateless
public class PriviligeBean implements PriviligeInterface 
{
	@PersistenceContext
	EntityManager em;
	
	@Override
	public List<Privilege> lister() {
		return  em.createQuery("from Privilege").getResultList();
	}
	@Override
	public Privilege chercher(int idP) {
		return em.find(Privilege.class, idP);
	}
}
